<template>
  <div class="hello">
    <button @click="getData">获取数据</button>
    <button @click="mockPost">mock post请求</button>
  </div>
</template>

<script>
import axios from 'axios'
export default {
  methods: {
    getData () {
      axios.get('/api/userList').then(res => {
        console.log(res.data)
      })
    },
    // mock post请求
    mockPost () {
      axios.post('/api/login').then(res => {
        console.log(res)
      })
    }
  }
}
</script>

<style scoped>
</style>
